import { lazy } from 'react'
import { RouterList } from '../utils/index.d'
export let Routers: RouterList = [
    {
        path: '/home/index',
        element: lazy(() => import('../pages/home/index/Index'))
    },
    {
        path: '/home/order',
        element: lazy(() => import('../pages/home/order/Order'))
    },
    {
        path: '/home/customer',
        element: lazy(() => import('../pages/home/customer/Customer'))
    },
    {
        path: '/home/my',
        element: lazy(() => import('../pages/home/my/My'))
    },
]

const routes = [
    {
        path: '/',
        to: '/home/index'
    },
    {
        path: '/home',
        element: lazy(() => import('../pages/Home')),
        children: Routers
    },
    {
        path: '/login',
        element: lazy(() => import('../pages/login/Login'))
    },
    {
        path: '/register',
        element: lazy(() => import('../pages/register/Register'))
    },
    {
        path: '/detail',
        element: lazy(() => import('../pages/detail/Detail'))
    },
]

export default routes